package auxFunctions;

import GA.Gene;

public class ChromosomeFun {

	public static boolean containsGen(Gene g, Gene[] gl){
		for (int i = 0; i < gl.length; i++)
			if (g.equals(gl[i])) return true;
		return false;
	}
	
	/** Returns if gl contains g between [begin, end) **/
	public static boolean containsGen(Gene g, Gene[] gl, int begin, int end){
		for (int i = begin; i < end; i++)
			if (g.equals(gl[i])) return true;
		return false;
	}
	
	// Returns if pos contains aux for 0 to index
	public static boolean contains(int[] pos, int index, int aux){
		for (int i = 0; i < index; i++)
			if (pos[i] == aux) return true;
		return false;
	}
}
